package com.anne.fish.service.img;

import java.io.File;

 

public class ImageManager {
	private ImageUploadManager imageUploadManager;

	public void setImageUploadManager(ImageUploadManager imageUploadManager) {
		this.imageUploadManager = imageUploadManager;
	}

	private ImageCompress imageCompress;

	public ImageParameter getGoodsImageParameter() {
		return this.imageUploadManager.getImageParameter();
	}

	public void setImageCompress(ImageCompress imageCompress) {
		this.imageCompress = imageCompress;
	}

	public boolean isRemote() {
		return imageUploadManager.isRemote();
	}

	public File compress(File file, String target, int width, int height, String imageType) throws Exception {

		return imageCompress.compress(file, target, width, height, imageType);
	}

	public String upload(File file, String destFileName,String dir) throws Exception {
		return imageUploadManager.upload(file, destFileName ,dir);
	}

	public byte[] compress(byte[] data, int width, int height, String imageType) throws Exception {
		return imageCompress.compress(data, width, height, imageType);
	}

	public String upload(byte[] data, String destFileName ,String uploadDir) throws Exception {
		return imageUploadManager.upload(data, destFileName,uploadDir);
	}

}
